#include <iostream>
#include <vector>

void ReadInput (std::vector <int> &elements, int array_size) {
    for (int iteration = 0; iteration < array_size; ++iteration) {
        int element;
        std::cin >> element;
        elements.push_back(element);
    }
}

void PrintAnswer (std::vector <int> &answer) {
    for (auto element : answer) {
        std::cout << element << " ";
    }
}

template <typename iterator_type>
void Merge (iterator_type first_begin, iterator_type first_end,
            iterator_type second_begin, iterator_type second_end,
            std::vector <int> &output_vector) {
    while (first_begin != first_end || second_begin != second_end) {
        if (first_begin == first_end) {
            output_vector.push_back (*second_begin);
            ++second_begin;
        } else if (second_begin == second_end) {
            output_vector.push_back (*first_begin);
            ++first_begin;
        } else {
            if (*first_begin < *second_begin) {
                output_vector.push_back (*first_begin);
                ++first_begin;
            } else {
                output_vector.push_back (*second_begin);
                ++second_begin;
            }
        }
    }
}

std::vector <int> Sort (std::vector <int> elements) {
    if (elements.size() <= 1) {
        return elements;
    }
    std::vector <int> left_half, right_half;
    for (int element_number = 0; element_number < elements.size();
         ++element_number) {
        if (element_number < elements.size() / 2) {
            left_half.push_back (elements[element_number]);
        } else {
            right_half.push_back (elements[element_number]);
        }
    }
    std::vector <int> output_vector;
    left_half = Sort (left_half);
    right_half = Sort (right_half);
    Merge (left_half.begin(), left_half.end(),
                  right_half.begin(), right_half.end(), output_vector);
    return output_vector;
}

int main() {
    int array_size;
    std::cin >> array_size;
    if (array_size == 0) {
        return 0;
    }
    std::vector <int> elements;
    ReadInput (elements, array_size);
    elements = Sort (elements);
    PrintAnswer (elements);
}
